package com.neu.controller;


import com.github.pagehelper.PageInfo;
import com.neu.common.Result;
import com.neu.entity.Disease;
import com.neu.entity.Params;
import com.neu.entity.Video;
import com.neu.service.DiseaseService;
import com.neu.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 陈鲲鹏
 * @since 2025-02-08
 */
@Api(tags = "常见病管理接口")
@RestController
@RequestMapping("/video")
public class VideoController {
    @Autowired
    private VideoService videoService;

    @ApiOperation("新增视频接口")
    @PostMapping
    public Result saveVideo(@RequestBody Video video){
        videoService.add(video);
        return Result.success();
    }
    //员工信息分页查询,基于mybatis_plus插件进行分页查询
    @GetMapping("/page")
    public Result page(Params params){
        PageInfo<Video> info = videoService.findBySearch(params);
        return Result.success(info);
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Integer id){
        videoService.delete(id);
        return Result.success();
    }

}
